home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / AppleTalk Remote access / Scripts ARA ƒ / GV TP Serial 1.7b2 < prev    next >
Encoding:
Text File  |  1992-12-03  |  5.4 KB  |  271 lines  |  [mlts/slnk]

  1. ! 08/02/92 TelePort Gold draft
  2. ! 10/23/92 CTC Switched to new script written by RBH
  3. ! 10/26/92 CTC Fix for International calling(S7=60)
  4. ! 11/11/92 CTC Rewrote the Hang up section of the script to use AT\Y
  5. ! 11/18/92 CTC Fix for Shiva LanRover/L image 1.0 problem
  6. !
  7. @ORIGINATE
  8. @ANSWER
  9. !
  10. ! Talk to the modem at 19,200 bps.  
  11. !
  12. serreset 19200, 0, 8, 1
  13. !
  14. ! &f    - recall factory settings
  15. ! &d0   - Ignore DTR
  16. ! &k3   - Enable Hardware flow control
  17. ! w2    - Connect result code reports modem speed
  18. ! \q3   - Use RTS/CTS flow control in full-duplex mode
  19. ! \k0   - Enter command state but do not send break
  20. ! \j0   - Disable port rate adjust
  21. ! s7=60 - To allow for an international call
  22. !
  23. HSReset 0 1 0 0 0 0
  24. settries 0
  25. matchclr
  26. @LABEL 1
  27. matchstr 1 4 "OK\13\10"
  28. write "AT&f&d0&k3\\k0\\j0w2\\q3s7=60\13"
  29. matchread 30
  30. inctries
  31. iftries 2 59
  32. ! Modem is not responding, reset and send a break
  33. SBreak
  34. jump 1
  35. !
  36. ! Next, Set up the configuration: Turn off auto answer and command echo.   
  37. !
  38. ! S0=0 - Don't answer calls
  39. ! E0   - Turn command echo off
  40. @LABEL 4
  41. matchclr
  42. pause 5
  43. matchstr 1 5 "OK\13\10"
  44. write "ATS0=0E0\13"
  45. matchread 30
  46. jump 59
  47. !
  48. ! Note: When the "\Nn" commands of the TP Serial are like those of the PP we
  49. !       will need to change the \Nn setting to allow a V.42 connection without
  50. !       a fallback to MNP4
  51. !
  52. ! \n0 - disable v.42 autoreliable
  53. ! %c0 - turn off MNP5 compression
  54. @LABEL 5
  55. pause 5
  56. matchstr 1 6 "OK\13\10"
  57. write "AT\\n0%c0\13"
  58. matchread 30
  59. jump 59
  60. !
  61. !
  62. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  63. !
  64. @LABEL 6
  65. ifstr 2 8 "1"
  66. pause 5
  67. matchstr 1 8 "OK\13\10"
  68. write "ATM0\13"
  69. matchread 30
  70. jump 59
  71. !
  72. ! The modem is ready so enable answering, or originate a call
  73. !
  74. @LABEL 8
  75. pause 5
  76. ifANSWER 30
  77. note "Dialing ^1" 3
  78. write "ATDT^1\13"
  79. !
  80. @LABEL 9
  81. matchstr 1  11 "CONNECT 1200\13\10"
  82. matchstr 2  12 "CONNECT 2400\13\10"
  83. matchstr 3  13 "CONNECT 4800\13\10"
  84. matchstr 4  19 "CONNECT 7200\13\10"
  85. matchstr 5  14 "CONNECT 9600\13\10"
  86. matchstr 6  20 "CONNECT 12000\13\10"
  87. matchstr 7  18 "CONNECT 14400\13\10"
  88. matchstr 8  50 "NO CARRIER\13\10"
  89. matchstr 9  50 "ERROR\13\10"
  90. matchstr 10 52 "NO DIAL TONE\13\10"
  91. matchstr 11 53 "BUSY\13\10"
  92. matchstr 12 54 "NO ANSWER\13\10"
  93. matchread 700
  94. jump 59
  95. !
  96. ! Notice that all we do for different connect speeds is issue a 
  97. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  98. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  99. ! CommunicatingAt tells ARA what the actual line speed is so that it
  100. ! can set it's timers appropriately.  I guess your performance would be
  101. ! sub-optimal if you don't set this...
  102. !
  103. @LABEL 11
  104. note "Communicating at 1200 bps." 2
  105. CommunicatingAt 1200
  106. jump 15
  107. !
  108. @LABEL 12
  109. note "Communicating at 2400 bps." 2
  110. CommunicatingAt 2400
  111. jump 15
  112. !
  113. @LABEL 13
  114. note "Communicating at 4800 bps." 2
  115. CommunicatingAt 4800
  116. jump 15
  117. !
  118. @LABEL 19
  119. note "Communicating at 7200 bps." 2
  120. CommunicatingAt 7200
  121. jump 15
  122. !
  123. @LABEL 14
  124. note "Communicating at 9600 bps." 2
  125. CommunicatingAt 9600
  126. jump 15
  127. !
  128. @LABEL 20
  129. note "Communicating at 12000 bps." 2
  130. CommunicatingAt 12000
  131. jump 15
  132. !
  133. @LABEL 18
  134. note "Communicating at 14400 bps." 2
  135. CommunicatingAt 14400
  136. jump 15
  137. !
  138. !
  139. @LABEL 15
  140. HSReset 0 1 0 0 0 0 
  141. ifANSWER 16
  142. pause 30
  143. @LABEL 16
  144. exit 0
  145. !
  146. ! @ANSWER
  147. ! Set up the modem to answer
  148. !
  149. @LABEL 30
  150. write "ATS0=1\13"
  151. matchstr 1 31 "OK\13\10"
  152. matchread 30
  153. jump 59
  154. !
  155. @LABEL 31
  156. matchstr 1  32 "RING\13\10"
  157. matchstr 2  11 "CONNECT 1200\13\10"
  158. matchstr 3  12 "CONNECT 2400\13\10"
  159. matchstr 4  13 "CONNECT 4800\13\10"
  160. matchstr 5  19 "CONNECT 7200\13\10"
  161. matchstr 6  14 "CONNECT 9600\13\10"
  162. matchstr 7  20 "CONNECT 12000\13\10"
  163. matchstr 8  18 "CONNECT 14400\13\10"
  164. matchstr 9  50 "NO CARRIER\13\10"
  165. matchstr 10 50 "ERROR\13\10"
  166. matchstr 11 52 "NO DIAL TONE\13\10"
  167. matchstr 12 53 "BUSY\13\10"
  168. matchstr 13 54 "NO ANSWER\13\10"
  169. matchread 700
  170. jump 31
  171. !
  172. @LABEL 32
  173. userhook 1
  174. note "Answering phone..." 2
  175. jump 31
  176. !
  177. ! 50: error messages
  178. !
  179. @LABEL 50
  180. exit -6021
  181. !
  182. @LABEL 52
  183. exit -6020
  184. !
  185. @LABEL 53
  186. exit -6022
  187. !
  188. @LABEL 54
  189. exit -6023
  190. !
  191. @LABEL 59
  192. exit -6019
  193. !
  194. ! Hang up the modem
  195. !
  196. @HANGUP
  197. @LABEL 60
  198. settries 0
  199. serreset 19200, 0, 8, 1
  200. HSReset 0 1 0 0 0 0
  201. @LABEL 61
  202. !
  203. ! In order to hang up quickly, we go into command state and attempt a reliable
  204. ! connection. While we are attempting to re-establish
  205. ! the connection we hit return and cancel the attempt causing the modem to
  206. ! hang up.
  207. !
  208. SBreak
  209. pause 20
  210. Flush               ! prevent disconnect garbage
  211. write "\13"         ! start on a clean line
  212. @LABEL 96
  213. matchclr
  214. matchstr 1 97 "OK\13\10"
  215. write "AT\13"
  216. matchread 30
  217. inctries
  218. iftries 3 59
  219. jump 96
  220. @LABEL 97
  221. settries 0
  222. @LABEL 98
  223. matchclr
  224. matchstr 1 62 "NO CARRIER\13\10"
  225. Flush                                  ! prevent disconnect garbage
  226. write "AT\\Y\13"                       ! Attempt to re-establish connection
  227. !pause 2                               ! Causes problems with LanRover/L 1.0
  228. write "ho\13ho\13"                 ! Dreaded Christmas Abort re-connect
  229. matchread 150                      ! to hang up the modem
  230. inctries
  231. iftries 2 59
  232. jump 98
  233. @LABEL 62
  234. settries 0
  235. !
  236. ! recall the factory settings. (see note at top of script)
  237. !
  238. @LABEL 63
  239. matchclr
  240. matchstr 1 92 "OK\13\10"
  241. write "ATZ\13"
  242. matchread 30
  243. inctries
  244. iftries 3 59
  245. jump 63
  246. @LABEL 92
  247. Settries 0
  248. @LABEL 93
  249. matchclr
  250. matchstr 1 64 "OK\13\10"
  251. write "AT&f&d0&k3\\k0\\j0w2\\q3s7=60\13"
  252. matchread 30
  253. inctries
  254. iftries 3 59
  255. jump 93
  256. !
  257. ! Turn off auto answer.
  258. ! S0=0 - Don't try to answer the phone
  259. !
  260. @LABEL 64
  261. pause 5
  262. matchstr 1 65 "OK\13\10"
  263. write "ATS0=0\13"
  264. matchread 20
  265. !
  266. @LABEL 65
  267. exit 0
  268.